#ifndef __I2C_H__
#define __I2C_H__
#include "driver/gpio.h"
#include "Utils.h"

#define I2C_SDA_PIN GPIO_NUM_2
#define I2C_SCL_PIN GPIO_NUM_1

#define I2C_SDA_IN()  gpio_set_direction(I2C_SDA_PIN, GPIO_MODE_INPUT)
#define I2C_SDA_OUT() gpio_set_direction(I2C_SDA_PIN, GPIO_MODE_OUTPUT)
#define I2C_SDA_H()   gpio_set_level(I2C_SDA_PIN, 1)
#define I2C_SDA_L()   gpio_set_level(I2C_SDA_PIN, 0)
#define I2C_SCL_H()   gpio_set_level(I2C_SCL_PIN, 1)
#define I2C_SCL_L()   gpio_set_level(I2C_SCL_PIN, 0)

#define I2C_SDA_READ() gpio_get_level(I2C_SDA_PIN)

void I2C_Init(void);
void I2C_Read(uint8_t slave_addr, uint8_t *data);
#endif